<template>
	<view class="goods_item">
		
		<view class="good_list" >
			<view class="goods_item" v-for="item in hotGoots" :key="item.id" @click="clickGoods(item.id)">
				<image :src="item.img_url"  v-if="item.img_url"></image>
				<view class="price">
					<text>¥{{item.sell_price}}</text>
					<text>¥{{item.market_price}}</text>
				</view>
				<view class="goods_name">
					{{item.title}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['hotGoots'],
		data() {
			return {
				
			}
		},
		onLoad() {
			// console.log(hotGoots)
		},
		methods: {
			//goGoodsDetail
			clickGoods(id) {
				this.$emit('goodsDetails',id)
			}
		}
	}
</script>

<style lang="scss">
	// .goods_item {
	// 	background-color: #ccc;
	// }
	
	.good_list {
		display: flex;
		padding: 0 15rpx;
		flex-wrap: wrap;
		justify-content: space-between;
		.goods_item {
			background-color: #fff;
			width: 355rpx;
			margin: 10rpx 0;
			padding: 15rpx;
			box-sizing: border-box;
			image {
				width: 80%;
				height: 150px;
				display: block;
				margin: auto;
			}
			.price {
				margin: 10rpx 0;
				color: $shop-color;
				font-size: 36rpx;
				text:nth-child(2) {
					color: #ccc;
					font-size: 28rpx;
					margin-left: 17rpx;
					text-decoration: line-through;
				}
			}
			.goods_name {
				font-size: 28rpx;
				line-height: 50rpx;
				padding-bottom: 15rpx;
			}
		}
	}
</style>
